package com.bw.permission.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bw.permission.entity.User;
import com.bw.permission.entity.UserVo;
import com.bw.permission.mapper.UserMapper;
import com.bw.permission.service.IUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zhanggm
 * @since 2020-10-28
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {

    @Override
    public User getByUsername(String username) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("username",username);
        return getOne(queryWrapper);
    }

    @Override
    public IPage<UserVo> getPageInfo(UserVo userVo, Page page) {
        return this.getBaseMapper().selectPageInfo(userVo,page);
    }
}
